package com.mycompany.lctwitter.persist.service;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mycompany.lctwitter.persist.dao.FootprintDao;
import com.mycompany.lctwitter.persist.model.Footprint;
import com.mycompany.lctwitter.persist.model.Location;
import com.mycompany.lctwitter.persist.model.User;

@Service("footprintService")
@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED, rollbackFor = Exception.class)
public class FootprintService {

    @Resource
    private FootprintDao footprintDao;

    @Transactional
    public void add(User user, Location location, Date date) {
        footprintDao.add(user, location, date);
    }

    public List<Footprint> list(Long userId) {
        return footprintDao.list(userId);
    }
}
